package com.systemframework.sys.dto.request;


import com.systemframework.sys.dto.request.common.PageResponseDTO;
import com.systemframework.valid.NotBlankThenPattern;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.List;

/**
 * @author summer
 * @date 2023-03-07 11:38
 */
@EqualsAndHashCode(callSuper = true)
@Data
public class SysUserRequestDTO extends PageResponseDTO implements Serializable {

    @NotBlank(message = "用户账号不能为空")
    private String username;

    @NotBlank(message = "用户姓名不能为空")
    private String name;

    @NotNull(message = "用户状态不能为空")
    private Integer state;

    private List<Integer> roleIds;

    @NotNull(message = "用户性别不能为空")
    private Integer sex;

    @NotBlankThenPattern(regexp = "^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\\.[a-zA-Z0-9_-]+)+$" ,message="邮箱格式错误")
    private String email;

    @NotBlankThenPattern(regexp = "^1[3-9]\\d{9}$",message = "手机号码格式错误")
    private String phone;

    private String avatar;

    private Integer id;

    private Integer deptId;

    private Boolean showImage;

    private String password;


}
